
// src/api/pro.ts 封装 产品的 相关的接口请求
import request from '@/utils/request'



export function addApproval(params) {
  return request({
    url: '/approval-data/add',
    method: 'POST',
    data: params
  })
}

export function updateApproval(params) {
  return request({
    url: '/approval-data/update',
    method: 'POST',
    data: params
  })
}

export function deleteApproval(id) {
  return request({
    url: '/approval-data/delete/'+id,
    method: 'GET'
  })
}


export function listApproval() {
  return request({
    url: '/approval-data/list',
    method: 'GET'
  })
}

export function listApprovalByReportId(data) {
  return request({
    url: '/approval-data/list-report',
    method: 'GET',
    params:data
  })
}

export function listApprovalByApproval(id) {
  return request({
    url: '/approval-data/list-approval/'+id,
    method: 'GET'
  })
}

//审批通过
export function agreeApprove(id,state) {
  return request({
    url: '/approval-data/agree?id='+id+'&state='+state,
    method: 'GET'
  })
}

//审批不通过
export function disagreeApprove(id) {
  return request({
    url: '/approval-data/disagree/'+id,
    method: 'GET'
  })
}

//根据id查 用于编辑和查看
export function getApproveById(id) {
  return request({
    url: '/approval-data/display/'+id,
    method: 'GET'
  })
}

//查询未审批和已通过的
export function queryData(params) {
  return request({
    url: '/approval-data/query-data',
    method: 'GET',
    params: params
  })
}